package net.apexes.demo.codegen.dslite.qvar;

import net.apexes.demo.codegen.dslite.entity.PaymentItemInfo;
import net.apexes.demo.codegen.dslite.qvar.base.QEntityBase;
import net.wafo.dslite.core.info.Index;

import net.wafo.dslite.core.dsl.*;

/**
 * QPaymentItemInfo is a DSLite query type for PaymentItemInfo
 * @see PaymentItemInfo
 */
public class QPaymentItemInfo extends QEntityBase<PaymentItemInfo> {

    public static final QPaymentItemInfo $ = new QPaymentItemInfo("PAYMENT_ITEM_INFO");

    public final StringColumn infoKey = varchar("INFO_KEY", 32).field("infoKey").notNull().build();

    public final StringColumn infoValue = varchar("INFO_VALUE", 64).field("infoValue").notNull().build();

    public final StringColumn shopId = varchar("SHOP_ID", 22).field("shopId").notNull().build();

    public class Indexs {

        public final Index primaryKeyF4 = index("PRIMARY_KEY_F4").unique().column(id).build();

    }

    public final Indexs ix = new Indexs();

    public QPaymentItemInfo(String tableName) {
        super(PaymentItemInfo.class, tableName);
    }

    @Override
    public PaymentItemInfo newEntity() {
        return new PaymentItemInfo();
    }

    @Override
    public Object getFieldValue(PaymentItemInfo entity, String fieldName) {
        switch (fieldName) {
            case "infoKey":
                return entity.getInfoKey();
            case "infoValue":
                return entity.getInfoValue();
            case "shopId":
                return entity.getShopId();
            default:
                return super.getFieldValue(entity, fieldName);
        }
    }

    @Override
    public void setFieldValue(PaymentItemInfo entity, String fieldName, Object value) {
        switch (fieldName) {
            case "infoKey":
                entity.setInfoKey((java.lang.String) value);
                break;
            case "infoValue":
                entity.setInfoValue((java.lang.String) value);
                break;
            case "shopId":
                entity.setShopId((java.lang.String) value);
                break;
            default:
                super.setFieldValue(entity, fieldName, value);
                break;
        }
    }

}

